package zdream.pmfield.stage.buff.ability;

import java.util.Objects;

import zdream.pmfield.data.foe.Ability;
import zdream.pmfield.stage.buff.disease.PoisonedBuff;
import zdream.pmfield.stage.buff.foe.FoeStageBuff;

/**
 * 不是所有的 {@link Ability} 都是转化成 {@link AbilityBuff} 的.
 * 比如中毒效果, {@link PoisonedBuff}
 *
 * @author Zdream
 * @date 2023-12-18
 * @since 0.0.1
 */
public abstract class AbilityBuff extends FoeStageBuff {
	public static final String ABILITY = "ability";

	public final Ability ability;

	public AbilityBuff(BuffDescription description) {
		super(description.foe);
		this.ability = Objects.requireNonNull(description.ability);
	}

	@Override
	public boolean is(String category) {
		return ABILITY.equals(category) || super.is(category) || ability.is(category);
	}

	@Override
	public String toString() {
		return ability.name;
	}
}
